<template>
    <td ref="td">{{ value }}</td>
</template>
<script>
export default {
    inject: ['rows'],
    data() {
        return {
            rows: this.rows,
            row: [],
            value: '',
        }
    },
    props: {
        column: {
            type: String,
            default: ''
        },
        title: {
            type: String,
            default: ''
        },
    },
    created() {
        
    },
    mounted() {
        //  获取当前行下标
        let index = this.$el.parentElement.dataset.index
        //  获取当前行数据
        this.row = this.rows[index]
        //  获取当前列数据
        this.value = this.row[this.column]
    },
}
</script>